package com.sharding.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * Created by dongjigong on 2018/6/6.
 *
 * @Email osbornjonny@126.com
 * @Description
 */
@Configuration
public class SpringJdbcConfig {

    @Autowired
    @Qualifier("shardingDataSource")
    private DataSource shardingDataSource;

    @Bean
    public JdbcTemplate jdbcTemplate() {
        return new JdbcTemplate(shardingDataSource);
    }
}
